#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int N = 110;
int n;
string s = "yizhong";
char g[N][N];
bool f[N][N];
int dx[] = { 0,-1,-1,-1,0,1,1,1 };
int dy[] = { -1,-1,0,1,1,1,0,-1 };

void dfs(int x, int y) {
	for (int i = 0; i < 8; i++) {
		int flag = 0;
		for (int j = 0; j < s.size(); j++) {
			int nx = x + j * dx[i], ny = y + j * dy[i];
			if (g[nx][ny] != s[j]) {
				flag = 1;
				break;
			}
		}
		if (flag) continue;
		for (int j = 0; j < s.size(); j++) {
			f[x + j * dx[i]][y + j * dy[i]] = 1;
		}
	}
}

int main() {
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cin >> g[i][j];
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			dfs(i, j);
		}
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			if (f[i][j]) cout << g[i][j];
			else cout << "*";
		}
		cout << endl;
	}
	return 0;
}